<!--#include file="../nav/admin_top.php" -->
<div class="titleDiv">
	<div class="titleCaption">
		<span class="captionSpan">单页信息管理</span>
		<span class="totalSpan"> <label id="captionNum"></label> </span>
	</div>
</div>
 
<div style="margin:10px auto">
	搜索：
	<input type="text" maxlength="12" id="keywords" class="searchs" /> 
	<input type="button"  onclick="fnSearchs()" value="查询"  />  	
</div> 
<div id="grids"></div> 
<script type="text/javascript">
var url_list = '/admin_page/index_list'; 
var url_modify = '/admin_page/modify'; 
var url_view = '/admin_page/view'; 
$().ready(function(){
	o2js.build('ymprompt'); 
	o2js.build('o2grid');
	showLoading();
	grids = new o2Grid({
		bind:'grids', 
		url:url_list,
		rowNum:100,
		imgpath:'/misc/vendors/o2js/o2grid/image',
		cols:[
			{index:'id',mapping:'a.id', name:'序号', width:40,sortable:false, func:function(val,row_index,column_name,json,R){
				 return  '<span title="ID：'+json.id+'" >'+((R.page - 1)*R.rowNum + (row_index+1))+'</span>';
			}}, 
			{index:'title',mapping:'a.title', name:'页面标题', width:450,func:function(val,row_index,column_name,json,R){
					return val;
				}
			},
			{index:'update_date',mapping:'a.update_date', name:'最后修改时间', width:250,func:function(val,row_index,column_name,json,R){
					return val;
				}
			},
			{index:'id',mapping:'a.id', name:'操作'	, width:150,sortable:false,func:function(val,row_index,column_name,json,R){
					return   ' <a href="javascript:void(0)" onclick="fnView('+json.id+')" style="color: "  ><img src="/misc/images/icos/finished.gif" />  内容预览</a> ' + ' <a href="'+url_modify+'?id='+json.id+'" style="color: "  ><img src="/misc/images/edit.gif" />  编辑</a> ';
				}
			}
		]
	});
	fnSearchs();	 
	$('#keywords').keypress(function(e){
		if(e.keyCode==13||e.keyCode==10){
			fnSearchs();
		}
	}); 
	
});   
function fnSearchs(){
	grids.setBaseParams({
		keywords:encodeURIComponent($('#keywords').val())
	}); 
	grids.load(1); 
}

/* 添加 */
function fnView(id){ 
	ymPrompt.close();
	ymPrompt.win({
		title:'页面内容预览',
		fixPosition:true,
		maxBtn:true,
		width: 700, 
		height: 500,
		iframe:{
			src:url_view+'?id='+id
		}
	}); 	
}
</script>
<!--#include file="../nav/admin_bottom.php" -->